import React, { Component } from 'react'
import { StyleSheet, View } from 'react-native'
import { connect } from 'react-redux'
import { Button } from '../components'

import { NavigationActions } from '../utils'


const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center'
  }
})
@connect()
class Detail extends Component {
  static navigationOptions = {
    title: 'Detail'
  }

  goBack = () => {
    this.props.dispatch(NavigationActions.back())
  }

  render() {
    return (
      <View style={styles.container}>
        <Button text="Go Back" onPress={this.goBack} />
      </View>
    )
  }
}


export default Detail
